﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class MasterPage : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {

        if (!IsPostBack)
        {
            string makhuvuc = Request.QueryString["makhuvuc"];
            if (makhuvuc != null)
                DropDownList1.SelectedValue = makhuvuc;
        }
    }
    protected void LinkButton1_Click(object sender, EventArgs e)
    {
        Session["Login"] = false;
        Response.Redirect("Dangnhap.aspx", false);
    }
    protected void LinkButton2_Click(object sender, EventArgs e)
    {
        Session["Login"] = false;
        Response.Redirect("Dangnhap.aspx", false);
    }

    protected void lglogin_Click(object sender, EventArgs e)
    {
        Session["Login"] = false;
        Response.Redirect("Dangnhap.aspx", false);
    }
    protected void lblogout_Click(object sender, EventArgs e)
    {
        Session["Login"] = false;
        Response.Redirect("Dangnhap.aspx", false);
    }
    protected void bttim_Click(object sender, EventArgs e)
    {
        //tat ca
        if (DropDownList1.SelectedValue == "-1")
            Response.Redirect("~/bando.aspx");
        else
            Response.Redirect("~/bando.aspx?makhuvuc=" + DropDownList1.SelectedValue);
    }
    protected void DropDownList1_DataBound(object sender, EventArgs e)
    {
        //them 1 dong tat ca vao drop
        DropDownList1.Items.Insert(0, new ListItem("Tất cả", "-1"));
    }
}
